feat(scicode): add SciCode dataset + 0-shot generation task#42
feat(scicode): add SciCode dataset + 0-shot generation task#42jack-scitix-ai wants to merge 2 commits into
Conversation
1475b67 to
75c2071
Compare
75c2071 to
032c61b
Compare
ethan-scitix
left a comment
There was a problem hiding this comment.
Request changes. Logic is faithful to upstream + the internal GLM-OpenEvals impl (verified: both jsonl checksums, h5 byte-identity via sha256, prompt templates, extract_python_script, and previous_llm_code handling all match). Three things to fix:
🔴 Blocking
- Missing gold-step files.
special_step_code()(sieval/community/scicode/prompts.py:102) readsdata/{13.6,62.1,76.3}.txt, but.gitignore:156(data/) excludes them — they're not committed and not on disk. Reproduced: all three raiseFileNotFoundError, so problems 13/62/76 crash ininfer()and pollute main-problem accuracy.reference_impl.notesclaims these are vendored, but they aren't. Suggest inlining them as a.pymodule (likecommunity/livecodebench/prompts/*.py) to avoid both the gitignore and wheel-packaging ([tool.pdm.build]declares noincludesfor data files).
🟠 Repro fidelity (blocks matching official numbers)
- Timeout.
timeout=300.0(sieval/tasks/scicode_0shot_gen.py:116) vs the official hardcoded1800in upstreamtest_generated_code.py. 6× shorter → spurious timeouts on slow numerical steps. Bump to1800or document why. - Temperature. Official generation is greedy (
temperature=0). Correctly not hardcoded here, but please note in the docstring/reference_impl.notesthat reproducing official numbers requirestemperature=0in the model config. (with_background=Falsedefault is already correct — matches the official headline mode.)
Nits
- Remove the unused
get_function_from_code/extract_function_nameexports (sieval/community/scicode/__init__.py) — dead code; they read as "aligning with upstream" but nothing calls them (upstream only uses them on the resume-from-disk path, which this task doesn't take). - Flesh out
reference_impl.noteswith the real deviations: h5 targets inlined + remote eval service (vs in-subprocess), special-step verbatim embed, and pipeline-fails-counted-as-unsolved accounting. - Document the sandbox dependency
sympy(injected by_cmp_upstream.py; not in any sieval dep group — must exist in the code-eval service image). _cmp_source()(sieval/community/scicode/harness.py:26) re-reads the file per tested step — wrap infunctools.lru_cache.
Blocking = the gold files + timeout; the rest can be quick follow-ups.
|
Thanks for the thorough review — all six addressed and pushed. Point by point: 🔴 Blocking
🟠 Repro fidelity
Nits
|
ethan-scitix
left a comment
There was a problem hiding this comment.
Request changes. Logic is faithful and the prior round is fully addressed, but verifying against the runs in outputs/ surfaced one blocking issue plus a few nits.
🔴 Blocking — committed code diverges from upstream, and the reported number isn't from it
Special steps are embedded verbatim (sieval/tasks/scicode_0shot_gen.py:170-189, sieval/community/scicode/prompts.py:96-102), but upstream (gencode_json.py) runs get_function_from_code(gold, extract_function_name(header)) — which resolves to __init__ and extracts a bare method, dropping the class wrapper for 13.6/62.1 (and EnlargedBlock for 62). This isn't cosmetic:
- In the
scicode-kimirun, problem 13's steps13.8–13.15all fail withNameError: Maxwell(extraction path). The committed verbatim code makes13.8/13.14pass (confirmed inscicode-kimi-p13; the model never re-definesMaxwell). On a 10-problem slice this moves main accuracy 20%→30%. - The PR's without-background 37.8 comes from
scicode-kimi, which used the old extraction path at T=0.0 — not the committed verbatim code, and not the "T=1.0 official hyperparams" stated for the with-bg number. There is no full-set run of the committed code in headline (without-background) mode. reference_impl.notessays reproduction needstemperature=0, but the validated with-bg number (49.3) used T=1.0;reference_impl.urlpoints at upstream (extraction) while the code does verbatim. Task isstatus="stable".
Please: (1) re-run the full 65-problem set with the committed code in without-background mode and update the number, with a single stated temperature; (2) decide which reference the numbers target (public upstream = extraction, or the internal verbatim variant) and make code/url/notes consistent, flagging the special-step handling as a score-relevant deviation; (3) set status="experimental" until a full run of the committed code validates it.
🟠 Should fix
postprocess(sieval/tasks/scicode_0shot_gen.py:243) opens the ~1 GB h5 synchronously per tested step insideasync def, stalling the loop for concurrent samples. Read once per problem orawait asyncio.to_thread(...).
⚪ Nits
- The evaluator caps memory at 1024 MB (
Sample.memory_limitdefault, not overridden here); upstream's subprocess has no cap — memory-heavy numerical steps could OOM here but pass upstream. Worth a note inreference_impl.notes. .gitignore:192-197: the personalscicode-kimi*.yamlentries will ship to OSS as noise — prefer a glob or.git/info/exclude.MULTISTEP_TEMPLATE(sieval/community/scicode/prompts.py:29-52) has a trailing\nupstream lacks (only affectswith_background=True).- Dataset description says "80 problems / 338 sub-steps" (
sieval/datasets/scicode.py:1,54); the headline test split is 65 / 288 (80/338 is test+dev).
Type
Summary
SciCodeDataset: 80 problems / 338 dependent sub-steps; upstream jsonl revision-pinned at69a8cfc, numeric targetsraw_ground.h5mirrored on HF as a plain HTTPS artifact.scicode_0shot_gen(SciCodeZeroShotGenTask): sequential per-sub-step generation in the generated-solutions (self-dependency) setting — step i conditions on the model's own code for steps 1..i-1 (upstream's default; gold-conditioning is not implemented, and the test split ships no per-step gold) — with an optional scientist-background axis, scored by the code-evaluator over HTTP.69a8cfc).sieval/community/scicode/(prompt templates, code parsing, HDF5 target readers, in-processscicode.compare.cmpshim), each carrying the upstream Apache-2.0 header — adapted from SciCode @69a8cfc.scicodeoptional-dependency group (h5py/numpy/scipy): the sieval side reads numeric targets (incl.scipy.sparsematrices) from the h5.source="scicode") must be deployed for eval runs; the sieval code + unit tests here are self-contained.Test Plan
Automated
ruff check && ruff format --check)ty checkormypy --strict)pdm run pytest)Manual
Full
scripts/check_preflight.pyPASS (task/dataset registration, links, dep-coverage, meta-index sync, version). Kimi-K2.6 score check (official hyperparams, generated-solutions, 65-problem test split):Checklist
Required (all PRs)
type(scope): description)AI-Generated Code - <model> (<provider>)in module docstringcore/If: New or Modified Benchmark
sieval dataset download <name>succeeds)__init__.pyIf: community/ Changes
If: New Dependency